<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>
</head>

<body>
    <pre>
        在构造函数以及原型对象中, 里面this指向的是实例对象
    </pre>

    <script>
        var that;

        function Person(name, age) {
            // that = this
            this.name = name;
            this.age = age;
        }

        Person.prototype.sayHi = "111";

        // 在构造函数和原型对象中，this 始终指向的是 实例对象
        var man = new Person("嬴政", 221);

        man.sex = "男";

        console.log(man.sex.toString());
    </script>
</body>

</html>